from django.db import models

from prj002.models.models import CreatTimeModel
from prj002.models.info import Info
from myuser.models import MyUser


class Clinical(CreatTimeModel):

    info = models.OneToOneField(Info, on_delete=models.CASCADE, related_name='clinical')

    owner = models.ForeignKey(MyUser, on_delete=models.CASCADE, related_name='prj002_clinical')

    zhong_bi = models.BooleanField(default=False, blank=True, verbose_name='闭经', help_text='闭经')
    zhong_bu = models.BooleanField(default=False, blank=True, verbose_name='不孕', help_text='不孕')
    zhong_xia = models.BooleanField(default=False, blank=True, verbose_name='癥瘕', help_text='癥瘕')
    zhong_beng = models.BooleanField(default=False, blank=True, verbose_name='崩漏', help_text='崩漏')
    zhong_yue = models.BooleanField(default=False, blank=True, verbose_name='月经失调', help_text='月经失调')
    zhong_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='中医诊断-其他', help_text='中医诊断-其他')

    bian_xu_piqi = models.BooleanField(default=False, blank=True, verbose_name='脾气虚证', help_text='脾气虚证')
    bian_xu_pishen = models.BooleanField(default=False, blank=True, verbose_name='脾肾阳虚证', help_text='脾肾阳虚证')
    bian_xu_piyang = models.BooleanField(default=False, blank=True, verbose_name='脾阳虚证', help_text='脾阳虚证')
    bian_xu_shenqi = models.BooleanField(default=False, blank=True, verbose_name='肾气虚证', help_text='肾气虚证')
    bian_xu_shenyin = models.BooleanField(default=False, blank=True, verbose_name='肾阴虚证', help_text='肾阴虚证')
    bian_xu_shenyang = models.BooleanField(default=False, blank=True, verbose_name='肾阳虚证', help_text='肾阳虚证')
    bian_xu_xue = models.BooleanField(default=False, blank=True, verbose_name='血虚证', help_text='血虚证')
    bian_xu_yin = models.BooleanField(default=False, blank=True, verbose_name='阴虚内热证', help_text='阴虚内热证')
    bian_xu_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='虚证-其他', help_text='虚证-其他')

    bian_shi_shire = models.BooleanField(default=False, blank=True, verbose_name='肝经湿热证', help_text='肝经湿热证')
    bian_shi_qizhi = models.BooleanField(default=False, blank=True, verbose_name='肝郁气滞证', help_text='肝郁气滞证')
    bian_shi_yure = models.BooleanField(default=False, blank=True, verbose_name='肝经郁热证', help_text='肝经郁热证')
    bian_shi_xueyu = models.BooleanField(default=False, blank=True, verbose_name='气滞血瘀证', help_text='气滞血瘀证')
    bian_shi_tanshi = models.BooleanField(default=False, blank=True, verbose_name='痰湿证', help_text='痰湿证')
    bian_shi_hujie = models.BooleanField(default=False, blank=True, verbose_name='痰瘀互结证', help_text='痰瘀互结证')
    bian_shi_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='实证-其他', help_text='实证-其他')

    bian_xushi_pixu = models.BooleanField(default=False, blank=True, verbose_name='脾虚痰湿证', help_text='脾虚痰湿证')
    bian_xushi_ganyu = models.BooleanField(default=False, blank=True, verbose_name='肾虚肝郁证', help_text='肾虚肝郁证')
    bian_xushi_tanshi = models.BooleanField(default=False, blank=True, verbose_name='肾虛痰湿证', help_text='肾虛痰湿证')
    bian_xushi_xueyu = models.BooleanField(default=False, blank=True, verbose_name='肾虚血瘀证', help_text='肾虚血瘀证')
    bian_xushi_neire = models.BooleanField(default=False, blank=True, verbose_name='肾虚内热证', help_text='肾虚内热证')
    bian_xushi_shenyin = models.BooleanField(default=False, blank=True, verbose_name='肾（阴）虚湿热夹瘀证', help_text='肾（阴）虚湿热夹瘀证')
    bian_xushi_shenqi = models.BooleanField(default=False, blank=True, verbose_name='肾（气）虚湿热夹瘀证', help_text='肾（气）虚湿热夹瘀证')
    bian_xushi_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='虚实夹杂证-其他', help_text='虚实夹杂证-其他')

    xi_duo = models.BooleanField(default=False, blank=True, verbose_name='多囊卵巢综合征', help_text='多囊卵巢综合征')
    xi_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='西医诊断-其他', help_text='西医诊断-其他')

    def __str__(self):
        return '%s-%s' % (self.pk, self.info)

    class Meta:
        verbose_name = '临床诊断'
        verbose_name_plural = verbose_name
